{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "papermill": {
     "duration": 0.006367,
     "end_time": "2021-03-28T22:03:54.697539",
     "exception": false,
     "start_time": "2021-03-28T22:03:54.691172",
     "status": "completed"
    },
    "tags": []
   },
   "source": [
    "### Update\n",
    "\n",
    "Now it's fast thanks to [@higepon](https://www.kaggle.com/higepon) and [@romainfabre](https://www.kaggle.com/romainfabre) !\n",
    "\n",
    "\n",
    "### Description\n",
    "This is an example of making one dataframe to feed into one model.\n",
    "The result is [here](https://www.kaggle.com/kokitanisaka/indoorunifiedwifids).\n",
    "\n",
    "This code is super slow, if you know how to make it faster, please let me know.\n",
    "\n",
    "The created dataset is here.<br>\n",
    "https://www.kaggle.com/kokitanisaka/indoorunifiedwifids\n",
    "\n",
    "The oridinal dataset is here.<br>\n",
    "https://www.kaggle.com/hiro5299834/indoor-navigation-and-location-wifi-features"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "_cell_guid": "b1076dfc-b9ad-4769-8c92-a6c4dae69d19",
    "_uuid": "8f2839f25d086af736a60e9eeb907d3b93b6e0e5",
    "execution": {
     "iopub.execute_input": "2021-03-28T22:03:54.714074Z",
     "iopub.status.busy": "2021-03-28T22:03:54.713341Z",
     "iopub.status.idle": "2021-03-28T22:03:54.723124Z",
     "shell.execute_reply": "2021-03-28T22:03:54.723646Z"
    },
    "papermill": {
     "duration": 0.020908,
     "end_time": "2021-03-28T22:03:54.723958",
     "exception": false,
     "start_time": "2021-03-28T22:03:54.703050",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import glob\n",
    "import os\n",
    "\n",
    "import multiprocessing\n",
    "from multiprocessing import Pool\n",
    "\n",
    "num_cores = multiprocessing.cpu_count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-03-28T22:03:54.738493Z",
     "iopub.status.busy": "2021-03-28T22:03:54.737865Z",
     "iopub.status.idle": "2021-03-28T22:03:54.740941Z",
     "shell.execute_reply": "2021-03-28T22:03:54.741443Z"
    },
    "papermill": {
     "duration": 0.01159,
     "end_time": "2021-03-28T22:03:54.741602",
     "exception": false,
     "start_time": "2021-03-28T22:03:54.730012",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "ITEMS_TO_TAKE = 100"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-03-28T22:03:54.755409Z",
     "iopub.status.busy": "2021-03-28T22:03:54.754829Z",
     "iopub.status.idle": "2021-03-28T22:03:54.790414Z",
     "shell.execute_reply": "2021-03-28T22:03:54.789876Z"
    },
    "papermill": {
     "duration": 0.043611,
     "end_time": "2021-03-28T22:03:54.790545",
     "exception": false,
     "start_time": "2021-03-28T22:03:54.746934",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "base_path = '..'\n",
    "feature_dir = f\"{base_path}/input/indoor-navigation-and-location-wifi-features\"\n",
    "train_files = sorted(glob.glob(os.path.join(feature_dir, '*_train.csv')))\n",
    "test_files = sorted(glob.glob(os.path.join(feature_dir, '*_test.csv')))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-03-28T22:03:54.804971Z",
     "iopub.status.busy": "2021-03-28T22:03:54.804035Z",
     "iopub.status.idle": "2021-03-28T22:03:54.812487Z",
     "shell.execute_reply": "2021-03-28T22:03:54.812953Z"
    },
    "papermill": {
     "duration": 0.016782,
     "end_time": "2021-03-28T22:03:54.813100",
     "exception": false,
     "start_time": "2021-03-28T22:03:54.796318",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "def generate_training_data(train_file):\n",
    "    train = pd.read_csv(train_file)\n",
    "\n",
    "    file_name = train_file.split('/')[-1]\n",
    "\n",
    "    num_of_lines = train.shape[0]\n",
    "    print(f'{file_name} : {num_of_lines}')\n",
    "\n",
    "    data = []\n",
    "    for i in range(num_of_lines):\n",
    "        if i % 100 == 0:\n",
    "            print(f'current:{i}')\n",
    "\n",
    "        tmp = train.iloc[i,1:-4].astype(int).sort_values(ascending=False).head(ITEMS_TO_TAKE)\n",
    "        target = train.iloc[i,-4:]\n",
    "        line = [*tmp.index.astype(str), *tmp.values, *target]\n",
    "        data.append(line)\n",
    "    data = pd.DataFrame(data)\n",
    "    data.columns = [f'bssid_{str(i)}' for i in range(ITEMS_TO_TAKE)] + [f'rssi_{str(i)}' for i in range(ITEMS_TO_TAKE)] + ['x','y','floor','path']\n",
    "    data.to_csv(f'../input/indoor-unified-wifi-ds/{file_name}', index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "_kg_hide-output": true,
    "execution": {
     "iopub.execute_input": "2021-03-28T22:03:54.827741Z",
     "iopub.status.busy": "2021-03-28T22:03:54.827157Z",
     "iopub.status.idle": "2021-03-28T22:20:54.999898Z",
     "shell.execute_reply": "2021-03-28T22:20:54.999160Z"
    },
    "papermill": {
     "duration": 1020.181062,
     "end_time": "2021-03-28T22:20:55.000099",
     "exception": false,
     "start_time": "2021-03-28T22:03:54.819037",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5d2709a003f801723c3251bf_train.csv : 3940\n",
      "current:0\n",
      "current:100\n",
      "current:200\n",
      "current:300\n",
      "current:400\n",
      "current:500\n",
      "current:600\n",
      "current:700\n",
      "current:800\n",
      "current:900\n",
      "current:1000\n",
      "current:1100\n",
      "5d27097f03f801723c320d97_train.csv : 10507\n",
      "current:0\n",
      "current:1200\n",
      "current:1300\n",
      "current:100\n",
      "current:1400\n",
      "5a0546857ecc773753327266_train.csv : 9296\n",
      "current:0\n",
      "current:1500\n",
      "current:200\n",
      "current:1600\n",
      "current:1700\n",
      "current:100\n",
      "current:300\n",
      "current:1800\n",
      "current:1900\n",
      "current:400\n",
      "current:200\n",
      "current:2000\n",
      "current:500\n",
      "current:2100\n",
      "current:300\n",
      "current:2200\n",
      "current:600\n",
      "current:2300\n",
      "current:400\n",
      "current:2400\n",
      "current:700\n",
      "current:2500\n",
      "current:800\n",
      "current:500\n",
      "current:2600\n",
      "current:2700\n",
      "current:900\n",
      "current:2800\n",
      "current:600\n",
      "current:2900\n",
      "current:1000\n",
      "current:3000\n",
      "current:700\n",
      "current:1100\n",
      "current:3100\n",
      "current:3200\n",
      "current:1200\n",
      "current:800\n",
      "current:3300\n",
      "current:3400\n",
      "current:1300\n",
      "current:900\n",
      "current:3500\n",
      "current:1400\n",
      "current:3600\n",
      "current:3700\n",
      "current:1000\n",
      "current:1500\n",
      "current:3800\n",
      "current:3900\n",
      "current:1100\n",
      "current:1600\n",
      "current:1700\n",
      "current:1200\n",
      "current:1800\n",
      "current:1300\n",
      "current:1900\n",
      "current:2000\n",
      "current:1400\n",
      "current:2100\n",
      "current:1500\n",
      "current:2200\n",
      "current:1600\n",
      "current:2300\n",
      "current:2400\n",
      "current:1700\n",
      "current:2500\n",
      "current:1800\n",
      "current:2600\n",
      "5d2709b303f801723c327472_train.csv : 15358\n",
      "current:0\n",
      "current:1900\n",
      "current:2700\n",
      "current:100\n",
      "current:200\n",
      "current:2800\n",
      "current:2000\n",
      "current:300\n",
      "current:2900\n",
      "current:400\n",
      "current:2100\n",
      "current:3000\n",
      "current:500\n",
      "current:3100\n",
      "current:2200\n",
      "current:600\n",
      "current:700\n",
      "current:3200\n",
      "current:2300\n",
      "current:800\n",
      "current:3300\n",
      "current:900\n",
      "current:2400\n",
      "current:3400\n",
      "current:1000\n",
      "current:3500\n",
      "current:2500\n",
      "current:1100\n",
      "current:1200\n",
      "current:3600\n",
      "current:2600\n",
      "current:1300\n",
      "current:3700\n",
      "current:1400\n",
      "current:2700\n",
      "current:3800\n",
      "current:1500\n",
      "current:2800\n",
      "current:3900\n",
      "current:1600\n",
      "current:1700\n",
      "current:4000\n",
      "current:2900\n",
      "current:1800\n",
      "current:4100\n",
      "current:1900\n",
      "current:3000\n",
      "current:4200\n",
      "current:2000\n",
      "current:3100\n",
      "current:2100\n",
      "current:4300\n",
      "current:2200\n",
      "current:3200\n",
      "current:4400\n",
      "current:2300\n",
      "current:4500\n",
      "current:3300\n",
      "current:2400\n",
      "current:4600\n",
      "current:2500\n",
      "current:3400\n",
      "current:2600\n",
      "current:4700\n",
      "current:3500\n",
      "current:2700\n",
      "current:4800\n",
      "current:2800\n",
      "current:3600\n",
      "current:4900\n",
      "current:2900\n",
      "current:5000\n",
      "current:3000\n",
      "current:3700\n",
      "current:5100\n",
      "current:3100\n",
      "current:3800\n",
      "current:3200\n",
      "current:5200\n",
      "current:3300\n",
      "current:3900\n",
      "current:5300\n",
      "current:3400\n",
      "current:5400\n",
      "current:3500\n",
      "current:4000\n",
      "current:5500\n",
      "current:3600\n",
      "current:4100\n",
      "current:3700\n",
      "current:5600\n",
      "5d27075f03f801723c2e360f_train.csv : 23666\n",
      "current:0\n",
      "current:3800\n",
      "current:4200\n",
      "current:5700\n",
      "current:3900\n",
      "current:5800\n",
      "current:4000\n",
      "current:4300\n",
      "current:100\n",
      "current:4100\n",
      "current:5900\n",
      "current:4400\n",
      "current:4200\n",
      "current:6000\n",
      "current:4300\n",
      "current:4500\n",
      "current:6100\n",
      "current:4400\n",
      "current:200\n",
      "current:6200\n",
      "current:4500\n",
      "current:4600\n",
      "current:4600\n",
      "current:6300\n",
      "current:4700\n",
      "current:4700\n",
      "current:6400\n",
      "current:300\n",
      "current:4800\n",
      "current:4800\n",
      "current:6500\n",
      "current:4900\n",
      "current:6600\n",
      "current:5000\n",
      "current:4900\n",
      "current:400\n",
      "current:5100\n",
      "current:6700\n",
      "current:5000\n",
      "current:5200\n",
      "current:6800\n",
      "current:5300\n",
      "current:5100\n",
      "current:6900\n",
      "current:5400\n",
      "current:500\n",
      "current:7000\n",
      "current:5200\n",
      "current:5500\n",
      "current:7100\n",
      "current:5600\n",
      "current:5300\n",
      "current:5700\n",
      "current:7200\n",
      "current:600\n",
      "current:5800\n",
      "current:5400\n",
      "current:7300\n",
      "current:5900\n",
      "current:7400\n",
      "current:5500\n",
      "current:6000\n",
      "current:700\n",
      "current:7500\n",
      "current:6100\n",
      "current:5600\n",
      "current:6200\n",
      "current:7600\n",
      "current:6300\n",
      "current:5700\n",
      "current:7700\n",
      "current:800\n",
      "current:6400\n",
      "current:7800\n",
      "current:5800\n",
      "current:6500\n",
      "current:7900\n",
      "current:6600\n",
      "current:5900\n",
      "current:900\n",
      "current:6700\n",
      "current:8000\n",
      "current:6000\n",
      "current:6800\n",
      "current:8100\n",
      "current:6900\n",
      "current:6100\n",
      "current:8200\n",
      "current:7000\n",
      "current:1000\n",
      "current:8300\n",
      "current:6200\n",
      "current:7100\n",
      "current:8400\n",
      "current:7200\n",
      "current:6300\n",
      "current:7300\n",
      "current:8500\n",
      "current:1100\n",
      "current:7400\n",
      "current:6400\n",
      "current:8600\n",
      "current:7500\n",
      "current:8700\n",
      "current:6500\n",
      "current:7600\n",
      "current:1200\n",
      "current:7700\n",
      "current:8800\n",
      "current:6600\n",
      "current:7800\n",
      "current:8900\n",
      "current:7900\n",
      "current:6700\n",
      "current:9000\n",
      "current:1300\n",
      "current:8000\n",
      "current:9100\n",
      "current:6800\n",
      "current:8100\n",
      "current:9200\n",
      "current:8200\n",
      "current:6900\n",
      "current:8300\n",
      "current:1400\n",
      "current:9300\n",
      "current:8400\n",
      "current:7000\n",
      "current:9400\n",
      "current:8500\n",
      "current:9500\n",
      "current:7100\n",
      "current:8600\n",
      "current:1500\n",
      "current:9600\n",
      "current:8700\n",
      "current:7200\n",
      "current:8800\n",
      "current:9700\n",
      "current:7300\n",
      "current:8900\n",
      "current:9800\n",
      "current:1600\n",
      "current:9000\n",
      "current:9900\n",
      "current:7400\n",
      "current:9100\n",
      "current:10000\n",
      "current:9200\n",
      "current:7500\n",
      "current:9300\n",
      "current:1700\n",
      "current:10100\n",
      "current:7600\n",
      "current:9400\n",
      "current:10200\n",
      "current:9500\n",
      "current:7700\n",
      "current:10300\n",
      "current:9600\n",
      "current:1800\n",
      "current:10400\n",
      "current:7800\n",
      "current:9700\n",
      "current:10500\n",
      "current:9800\n",
      "current:7900\n",
      "current:9900\n",
      "current:1900\n",
      "current:10000\n",
      "current:8000\n",
      "current:10100\n",
      "current:10200\n",
      "current:8100\n",
      "current:2000\n",
      "current:10300\n",
      "current:8200\n",
      "current:10400\n",
      "current:10500\n",
      "current:8300\n",
      "current:10600\n",
      "current:2100\n",
      "5d27099f03f801723c32511d_train.csv : 4251\n",
      "current:0\n",
      "current:8400\n",
      "current:10700\n",
      "current:100\n",
      "current:200\n",
      "current:10800\n",
      "current:8500\n",
      "current:300\n",
      "current:10900\n",
      "current:400\n",
      "current:2200\n",
      "current:500\n",
      "current:11000\n",
      "current:8600\n",
      "current:600\n",
      "current:700\n",
      "current:11100\n",
      "current:800\n",
      "current:8700\n",
      "current:11200\n",
      "current:900\n",
      "current:1000\n",
      "current:2300\n",
      "current:11300\n",
      "current:1100\n",
      "current:8800\n",
      "current:1200\n",
      "current:11400\n",
      "current:1300\n",
      "current:1400\n",
      "current:11500\n",
      "current:8900\n",
      "current:1500\n",
      "current:11600\n",
      "current:2400\n",
      "current:1600\n",
      "current:1700\n",
      "current:9000\n",
      "current:11700\n",
      "current:1800\n",
      "current:1900\n",
      "current:11800\n",
      "current:9100\n",
      "current:2000\n",
      "current:11900\n",
      "current:2100\n",
      "current:2500\n",
      "current:2200\n",
      "current:12000\n",
      "current:9200\n",
      "current:2300\n",
      "current:2400\n",
      "current:12100\n",
      "current:2500\n",
      "current:12200\n",
      "current:2600\n",
      "current:2700\n",
      "current:2600\n",
      "current:12300\n",
      "current:2800\n",
      "current:2900\n",
      "current:12400\n",
      "current:3000\n",
      "current:3100\n",
      "current:12500\n",
      "current:3200\n",
      "current:12600\n",
      "current:2700\n",
      "current:3300\n",
      "current:3400\n",
      "current:12700\n",
      "current:3500\n",
      "current:3600\n",
      "current:12800\n",
      "current:3700\n",
      "current:3800\n",
      "current:12900\n",
      "current:3900\n",
      "current:2800\n",
      "current:4000\n",
      "current:13000\n",
      "current:4100\n",
      "current:4200\n",
      "current:13100\n",
      "current:13200\n",
      "current:2900\n",
      "current:13300\n",
      "current:13400\n",
      "current:13500\n",
      "current:13600\n",
      "current:3000\n",
      "current:13700\n",
      "current:13800\n",
      "current:13900\n",
      "current:3100\n",
      "current:14000\n",
      "5c3c44b80379370013e0fd2b_train.csv : 9737\n",
      "current:0\n",
      "current:14100\n",
      "current:100\n",
      "current:14200\n",
      "current:3200\n",
      "current:14300\n",
      "current:200\n",
      "current:14400\n",
      "current:300\n",
      "current:14500\n",
      "current:3300\n",
      "current:400\n",
      "current:14600\n",
      "current:14700\n",
      "current:500\n",
      "current:14800\n",
      "current:600\n",
      "current:3400\n",
      "current:14900\n",
      "5d2709bb03f801723c32852c_train.csv : 17203\n",
      "current:0\n",
      "current:15000\n",
      "current:700\n",
      "current:15100\n",
      "current:100\n",
      "current:800\n",
      "current:15200\n",
      "current:3500\n",
      "current:200\n",
      "current:15300\n",
      "current:900\n",
      "current:300\n",
      "current:1000\n",
      "current:400\n",
      "current:3600\n",
      "current:500\n",
      "current:1100\n",
      "current:600\n",
      "current:1200\n",
      "current:700\n",
      "current:3700\n",
      "current:1300\n",
      "current:800\n",
      "current:900\n",
      "current:1400\n",
      "current:1000\n",
      "current:1500\n",
      "current:3800\n",
      "current:1100\n",
      "current:1600\n",
      "current:1200\n",
      "current:1700\n",
      "current:1300\n",
      "current:3900\n",
      "current:1800\n",
      "current:1400\n",
      "current:1500\n",
      "current:1900\n",
      "current:4000\n",
      "current:1600\n",
      "current:2000\n",
      "current:1700\n",
      "current:2100\n",
      "5d2709d403f801723c32bd39_train.csv : 10027\n",
      "current:0\n",
      "current:1800\n",
      "current:4100\n",
      "current:2200\n",
      "current:100\n",
      "current:1900\n",
      "current:200\n",
      "current:2000\n",
      "current:2300\n",
      "current:300\n",
      "current:2100\n",
      "current:4200\n",
      "current:2400\n",
      "current:400\n",
      "current:2200\n",
      "current:500\n",
      "current:2500\n",
      "current:2300\n",
      "current:600\n",
      "current:2600\n",
      "current:4300\n",
      "current:2400\n",
      "current:700\n",
      "current:2700\n",
      "current:2500\n",
      "current:800\n",
      "current:900\n",
      "current:2600\n",
      "current:2800\n",
      "current:4400\n",
      "current:1000\n",
      "current:2700\n",
      "current:2900\n",
      "current:1100\n",
      "current:2800\n",
      "current:3000\n",
      "current:1200\n",
      "current:2900\n",
      "current:4500\n",
      "current:1300\n",
      "current:3100\n",
      "current:3000\n",
      "current:1400\n",
      "current:3200\n",
      "current:3100\n",
      "current:1500\n",
      "current:3200\n",
      "current:4600\n",
      "current:3300\n",
      "current:1600\n",
      "current:3300\n",
      "current:1700\n",
      "current:3400\n",
      "current:3400\n",
      "current:1800\n",
      "current:3500\n",
      "current:4700\n",
      "current:1900\n",
      "current:3500\n",
      "current:2000\n",
      "current:3600\n",
      "current:3600\n",
      "current:2100\n",
      "current:3700\n",
      "current:3700\n",
      "current:4800\n",
      "current:2200\n",
      "current:3800\n",
      "current:3800\n",
      "current:2300\n",
      "current:3900\n",
      "current:2400\n",
      "current:3900\n",
      "current:4000\n",
      "current:4900\n",
      "current:2500\n",
      "current:4000\n",
      "current:4100\n",
      "current:2600\n",
      "current:4200\n",
      "current:4100\n",
      "current:2700\n",
      "current:5000\n",
      "current:2800\n",
      "current:4300\n",
      "current:4200\n",
      "current:2900\n",
      "current:4400\n",
      "current:4300\n",
      "current:3000\n",
      "current:4500\n",
      "current:5100\n",
      "current:3100\n",
      "current:4400\n",
      "current:4600\n",
      "current:3200\n",
      "current:4500\n",
      "current:4700\n",
      "current:3300\n",
      "current:4800\n",
      "current:4600\n",
      "current:5200\n",
      "current:3400\n",
      "current:4900\n",
      "current:3500\n",
      "current:4700\n",
      "current:5000\n",
      "current:3600\n",
      "current:4800\n",
      "current:5100\n",
      "current:3700\n",
      "current:5300\n",
      "current:4900\n",
      "current:5200\n",
      "current:3800\n",
      "current:3900\n",
      "current:5300\n",
      "current:5000\n",
      "current:4000\n",
      "current:5400\n",
      "current:5400\n",
      "current:5100\n",
      "current:4100\n",
      "current:5500\n",
      "current:4200\n",
      "current:5200\n",
      "current:5600\n",
      "current:4300\n",
      "current:5500\n",
      "current:5300\n",
      "current:5700\n",
      "current:4400\n",
      "current:5800\n",
      "current:5400\n",
      "current:4500\n",
      "current:5900\n",
      "current:4600\n",
      "current:5600\n",
      "current:5500\n",
      "current:6000\n",
      "current:4700\n",
      "current:5600\n",
      "current:4800\n",
      "current:6100\n",
      "current:5700\n",
      "current:4900\n",
      "current:5700\n",
      "current:6200\n",
      "current:5000\n",
      "current:5800\n",
      "current:6300\n",
      "current:5100\n",
      "current:6400\n",
      "current:5900\n",
      "current:5800\n",
      "current:5200\n",
      "current:6500\n",
      "current:5300\n",
      "current:6000\n",
      "current:6600\n",
      "current:5400\n",
      "current:6100\n",
      "current:6700\n",
      "current:5500\n",
      "current:5900\n",
      "current:6200\n",
      "current:5600\n",
      "current:6800\n",
      "current:5700\n",
      "current:6900\n",
      "current:6300\n",
      "current:5800\n",
      "current:6000\n",
      "current:7000\n",
      "current:6400\n",
      "current:5900\n",
      "current:7100\n",
      "current:6000\n",
      "current:6500\n",
      "current:7200\n",
      "current:6100\n",
      "current:6100\n",
      "current:6600\n",
      "current:7300\n",
      "current:6200\n",
      "current:7400\n",
      "current:6700\n",
      "current:6300\n",
      "current:6400\n",
      "current:7500\n",
      "current:6800\n",
      "current:6200\n",
      "current:6500\n",
      "current:7600\n",
      "current:6900\n",
      "current:6600\n",
      "current:7700\n",
      "current:7000\n",
      "current:6700\n",
      "current:6300\n",
      "current:7800\n",
      "current:6800\n",
      "current:7100\n",
      "current:7900\n",
      "current:6900\n",
      "current:7200\n",
      "current:8000\n",
      "current:7000\n",
      "current:6400\n",
      "current:8100\n",
      "current:7300\n",
      "current:7100\n",
      "current:7200\n",
      "current:8200\n",
      "current:7400\n",
      "current:7300\n",
      "current:8300\n",
      "current:6500\n",
      "current:7500\n",
      "current:7400\n",
      "current:8400\n",
      "current:7600\n",
      "current:7500\n",
      "current:8500\n",
      "current:7600\n",
      "current:7700\n",
      "current:6600\n",
      "current:8600\n",
      "current:7700\n",
      "current:8700\n",
      "current:7800\n",
      "current:7800\n",
      "current:8800\n",
      "current:7900\n",
      "current:7900\n",
      "current:6700\n",
      "current:8900\n",
      "current:8000\n",
      "current:8000\n",
      "current:9000\n",
      "current:8100\n",
      "current:8100\n",
      "current:9100\n",
      "current:8200\n",
      "current:6800\n",
      "current:8300\n",
      "current:8200\n",
      "current:9200\n",
      "current:8400\n",
      "current:9300\n",
      "current:8300\n",
      "current:8500\n",
      "current:6900\n",
      "current:9400\n",
      "current:8400\n",
      "current:8600\n",
      "current:9500\n",
      "current:8700\n",
      "current:8500\n",
      "current:9600\n",
      "current:8800\n",
      "current:7000\n",
      "current:8600\n",
      "current:9700\n",
      "current:8900\n",
      "current:8700\n",
      "current:9800\n",
      "current:9000\n",
      "current:9100\n",
      "current:9900\n",
      "current:8800\n",
      "current:7100\n",
      "current:9200\n",
      "current:10000\n",
      "current:8900\n",
      "current:9300\n",
      "current:10100\n",
      "current:9400\n",
      "current:9000\n",
      "current:7200\n",
      "current:10200\n",
      "current:9500\n",
      "current:9100\n",
      "current:10300\n",
      "current:9600\n",
      "current:9200\n",
      "current:9700\n",
      "current:10400\n",
      "current:7300\n",
      "current:9800\n",
      "current:10500\n",
      "current:9300\n",
      "current:9900\n",
      "current:10600\n",
      "current:9400\n",
      "current:10000\n",
      "current:10700\n",
      "current:7400\n",
      "current:9500\n",
      "current:10800\n",
      "current:9600\n",
      "current:10900\n",
      "current:7500\n",
      "current:9700\n",
      "current:11000\n",
      "current:11100\n",
      "current:11200\n",
      "current:7600\n",
      "current:11300\n",
      "current:11400\n",
      "current:11500\n",
      "5da138274db8ce0c98bbd3d2_train.csv : 2662\n",
      "current:0\n",
      "current:7700\n",
      "current:100\n",
      "current:200\n",
      "current:11600\n",
      "current:300\n",
      "current:400\n",
      "5d2709e003f801723c32d896_train.csv : 11042\n",
      "current:0\n",
      "current:500\n",
      "current:11700\n",
      "current:600\n",
      "current:100\n",
      "current:700\n",
      "current:800\n",
      "current:200\n",
      "current:11800\n",
      "current:900\n",
      "current:7800\n",
      "current:1000\n",
      "current:300\n",
      "current:1100\n",
      "current:11900\n",
      "current:1200\n",
      "current:400\n",
      "current:1300\n",
      "current:1400\n",
      "current:500\n",
      "current:12000\n",
      "current:1500\n",
      "current:600\n",
      "current:1600\n",
      "current:1700\n",
      "current:700\n",
      "current:7900\n",
      "current:1800\n",
      "current:12100\n",
      "current:1900\n",
      "current:800\n",
      "current:2000\n",
      "current:2100\n",
      "current:12200\n",
      "current:900\n",
      "current:2200\n",
      "current:2300\n",
      "current:1000\n",
      "current:2400\n",
      "current:12300\n",
      "current:2500\n",
      "current:1100\n",
      "current:2600\n",
      "current:8000\n",
      "current:1200\n",
      "current:12400\n",
      "current:1300\n",
      "current:12500\n",
      "current:1400\n",
      "current:1500\n",
      "current:12600\n",
      "current:8100\n",
      "current:1600\n",
      "current:12700\n",
      "current:1700\n",
      "current:1800\n",
      "current:12800\n",
      "current:1900\n",
      "current:2000\n",
      "current:12900\n",
      "current:8200\n",
      "current:2100\n",
      "current:13000\n",
      "current:2200\n",
      "current:2300\n",
      "current:13100\n",
      "current:2400\n",
      "current:2500\n",
      "current:8300\n",
      "current:13200\n",
      "current:2600\n",
      "current:2700\n",
      "current:13300\n",
      "5da1382d4db8ce0c98bbe92e_train.csv : 8999\n",
      "current:0\n",
      "current:2800\n",
      "current:13400\n",
      "current:2900\n",
      "current:100\n",
      "current:8400\n",
      "current:3000\n",
      "current:13500\n",
      "current:3100\n",
      "current:200\n",
      "current:3200\n",
      "current:13600\n",
      "current:3300\n",
      "current:300\n",
      "current:13700\n",
      "current:3400\n",
      "current:8500\n",
      "current:3500\n",
      "current:400\n",
      "current:13800\n",
      "current:3600\n",
      "current:3700\n",
      "current:13900\n",
      "current:500\n",
      "current:3800\n",
      "current:8600\n",
      "current:3900\n",
      "current:14000\n",
      "current:600\n",
      "current:4000\n",
      "current:14100\n",
      "current:4100\n",
      "current:700\n",
      "current:4200\n",
      "current:14200\n",
      "current:4300\n",
      "current:800\n",
      "current:8700\n",
      "current:4400\n",
      "current:14300\n",
      "current:4500\n",
      "current:900\n",
      "current:14400\n",
      "current:4600\n",
      "current:4700\n",
      "current:1000\n",
      "current:14500\n",
      "current:4800\n",
      "current:8800\n",
      "current:4900\n",
      "current:1100\n",
      "current:14600\n",
      "current:5000\n",
      "current:14700\n",
      "current:5100\n",
      "current:1200\n",
      "current:5200\n",
      "current:8900\n",
      "current:14800\n",
      "current:1300\n",
      "current:5300\n",
      "current:5400\n",
      "current:14900\n",
      "current:1400\n",
      "current:5500\n",
      "current:15000\n",
      "current:5600\n",
      "current:1500\n",
      "current:5700\n",
      "current:9000\n",
      "current:15100\n",
      "current:5800\n",
      "current:1600\n",
      "current:5900\n",
      "current:15200\n",
      "current:6000\n",
      "current:1700\n",
      "current:15300\n",
      "current:6100\n",
      "current:9100\n",
      "current:6200\n",
      "current:15400\n",
      "current:1800\n",
      "current:6300\n",
      "current:6400\n",
      "current:15500\n",
      "current:1900\n",
      "current:6500\n",
      "current:15600\n",
      "current:6600\n",
      "current:9200\n",
      "current:2000\n",
      "current:6700\n",
      "current:15700\n",
      "current:6800\n",
      "current:2100\n",
      "current:6900\n",
      "current:15800\n",
      "current:7000\n",
      "current:2200\n",
      "current:9300\n",
      "current:15900\n",
      "current:7100\n",
      "current:2300\n",
      "current:7200\n",
      "current:16000\n",
      "current:7300\n",
      "current:2400\n",
      "current:16100\n",
      "current:7400\n",
      "current:9400\n",
      "current:7500\n",
      "current:16200\n",
      "current:2500\n",
      "current:7600\n",
      "current:7700\n",
      "current:16300\n",
      "current:2600\n",
      "current:7800\n",
      "current:16400\n",
      "current:7900\n",
      "current:9500\n",
      "current:2700\n",
      "current:8000\n",
      "current:16500\n",
      "current:8100\n",
      "current:2800\n",
      "current:8200\n",
      "current:16600\n",
      "current:8300\n",
      "current:2900\n",
      "current:9600\n",
      "current:16700\n",
      "current:8400\n",
      "current:8500\n",
      "current:3000\n",
      "current:16800\n",
      "current:8600\n",
      "current:8700\n",
      "current:3100\n",
      "current:16900\n",
      "current:8800\n",
      "current:9700\n",
      "current:8900\n",
      "current:17000\n",
      "current:3200\n",
      "current:9000\n",
      "current:17100\n",
      "current:3300\n",
      "current:9100\n",
      "current:9200\n",
      "current:17200\n",
      "current:9800\n",
      "current:3400\n",
      "current:9300\n",
      "current:9400\n",
      "current:3500\n",
      "current:9500\n",
      "current:9600\n",
      "current:3600\n",
      "current:9700\n",
      "current:9900\n",
      "current:9800\n",
      "current:3700\n",
      "current:9900\n",
      "current:10000\n",
      "current:3800\n",
      "current:10100\n",
      "current:10000\n",
      "current:10200\n",
      "current:3900\n",
      "current:10300\n",
      "current:10400\n",
      "current:4000\n",
      "current:10500\n",
      "current:4100\n",
      "current:10600\n",
      "current:10100\n",
      "current:10700\n",
      "current:4200\n",
      "current:10800\n",
      "current:10900\n",
      "current:4300\n",
      "current:11000\n",
      "current:4400\n",
      "current:10200\n",
      "current:4500\n",
      "current:4600\n",
      "current:10300\n",
      "current:4700\n",
      "current:4800\n",
      "current:10400\n",
      "current:4900\n",
      "current:5000\n",
      "current:5100\n",
      "current:10500\n",
      "5da138314db8ce0c98bbf3a0_train.csv : 9012\n",
      "current:0\n",
      "current:5200\n",
      "current:100\n",
      "current:200\n",
      "current:5300\n",
      "current:10600\n",
      "current:300\n",
      "current:400\n",
      "current:5400\n",
      "current:500\n",
      "current:600\n",
      "current:5500\n",
      "current:700\n",
      "current:10700\n",
      "current:800\n",
      "current:5600\n",
      "current:900\n",
      "current:1000\n",
      "current:5700\n",
      "current:1100\n",
      "current:1200\n",
      "current:10800\n",
      "current:5800\n",
      "current:1300\n",
      "current:1400\n",
      "current:5900\n",
      "current:1500\n",
      "current:1600\n",
      "current:6000\n",
      "current:10900\n",
      "current:1700\n",
      "current:1800\n",
      "current:6100\n",
      "current:1900\n",
      "current:2000\n",
      "current:6200\n",
      "current:2100\n",
      "current:11000\n",
      "current:2200\n",
      "current:6300\n",
      "current:2300\n",
      "current:2400\n",
      "current:2500\n",
      "current:6400\n",
      "5d2709c303f801723c3299ee_train.csv : 10083\n",
      "current:0\n",
      "current:2600\n",
      "current:11100\n",
      "current:2700\n",
      "current:2800\n",
      "current:6500\n",
      "current:2900\n",
      "current:100\n",
      "current:3000\n",
      "current:11200\n",
      "current:6600\n",
      "current:3100\n",
      "current:3200\n",
      "current:3300\n",
      "current:200\n",
      "current:6700\n",
      "current:3400\n",
      "current:11300\n",
      "current:3500\n",
      "current:3600\n",
      "current:6800\n",
      "current:3700\n",
      "current:300\n",
      "current:3800\n",
      "current:6900\n",
      "current:3900\n",
      "current:4000\n",
      "current:11400\n",
      "current:7000\n",
      "current:4100\n",
      "current:400\n",
      "current:4200\n",
      "current:7100\n",
      "current:4300\n",
      "current:7200\n",
      "current:11500\n",
      "current:4400\n",
      "current:7300\n",
      "current:500\n",
      "current:4500\n",
      "current:4600\n",
      "current:7400\n",
      "current:11600\n",
      "current:4700\n",
      "current:4800\n",
      "current:7500\n",
      "current:600\n",
      "current:4900\n",
      "current:5000\n",
      "current:7600\n",
      "current:5100\n",
      "current:11700\n",
      "current:5200\n",
      "current:7700\n",
      "current:700\n",
      "current:5300\n",
      "current:5400\n",
      "current:7800\n",
      "current:5500\n",
      "current:5600\n",
      "current:11800\n",
      "current:7900\n",
      "current:800\n",
      "current:5700\n",
      "current:5800\n",
      "current:8000\n",
      "current:5900\n",
      "current:6000\n",
      "current:8100\n",
      "current:900\n",
      "current:11900\n",
      "current:6100\n",
      "current:6200\n",
      "current:8200\n",
      "current:6300\n",
      "current:6400\n",
      "current:8300\n",
      "current:1000\n",
      "current:6500\n",
      "current:12000\n",
      "current:8400\n",
      "current:6600\n",
      "current:6700\n",
      "current:8500\n",
      "current:6800\n",
      "current:1100\n",
      "current:6900\n",
      "current:8600\n",
      "current:7000\n",
      "current:12100\n",
      "current:7100\n",
      "current:8700\n",
      "current:7200\n",
      "current:1200\n",
      "current:7300\n",
      "current:8800\n",
      "current:7400\n",
      "current:7500\n",
      "current:12200\n",
      "current:8900\n",
      "current:7600\n",
      "current:1300\n",
      "current:7700\n",
      "current:7800\n",
      "current:7900\n",
      "current:12300\n",
      "current:8000\n",
      "current:1400\n",
      "current:8100\n",
      "current:8200\n",
      "current:8300\n",
      "current:8400\n",
      "current:12400\n",
      "current:1500\n",
      "current:8500\n",
      "current:8600\n",
      "current:8700\n",
      "current:8800\n",
      "current:1600\n",
      "current:12500\n",
      "current:8900\n",
      "current:9000\n",
      "current:1700\n",
      "current:12600\n",
      "current:1800\n",
      "current:12700\n",
      "5da1383b4db8ce0c98bc11ab_train.csv : 13196\n",
      "current:0\n",
      "current:100\n",
      "current:1900\n",
      "current:200\n",
      "5da138364db8ce0c98bc00f1_train.csv : 2767\n",
      "current:0\n",
      "current:100\n",
      "current:300\n",
      "current:200\n",
      "current:12800\n",
      "current:300\n",
      "current:400\n",
      "current:400\n",
      "current:2000\n",
      "current:500\n",
      "current:500\n",
      "current:600\n",
      "current:600\n",
      "current:700\n",
      "current:700\n",
      "current:800\n",
      "current:12900\n",
      "current:900\n",
      "current:800\n",
      "current:2100\n",
      "current:1000\n",
      "current:900\n",
      "current:1100\n",
      "current:1200\n",
      "current:1000\n",
      "current:1300\n",
      "current:1100\n",
      "current:1400\n",
      "current:13000\n",
      "current:1500\n",
      "current:2200\n",
      "current:1200\n",
      "current:1600\n",
      "current:1300\n",
      "current:1700\n",
      "current:1800\n",
      "current:1400\n",
      "current:1900\n",
      "current:2000\n",
      "current:1500\n",
      "current:2300\n",
      "current:13100\n",
      "current:2100\n",
      "current:1600\n",
      "current:2200\n",
      "current:2300\n",
      "current:1700\n",
      "current:2400\n",
      "current:1800\n",
      "current:2500\n",
      "current:2400\n",
      "current:2600\n",
      "current:1900\n",
      "current:2700\n",
      "current:13200\n",
      "current:2000\n",
      "current:2100\n",
      "current:2500\n",
      "current:2200\n",
      "current:2300\n",
      "current:13300\n",
      "current:2400\n",
      "current:2500\n",
      "current:2600\n",
      "current:2600\n",
      "current:2700\n",
      "current:13400\n",
      "current:2800\n",
      "current:2700\n",
      "current:2900\n",
      "5da138764db8ce0c98bcaa46_train.csv : 9420\n",
      "current:0\n",
      "current:3000\n",
      "current:100\n",
      "current:13500\n",
      "current:3100\n",
      "current:200\n",
      "current:2800\n",
      "current:3200\n",
      "current:3300\n",
      "current:300\n",
      "current:3400\n",
      "current:400\n",
      "current:3500\n",
      "current:13600\n",
      "current:2900\n",
      "current:500\n",
      "current:3600\n",
      "current:600\n",
      "current:3700\n",
      "current:700\n",
      "current:3800\n",
      "current:3000\n",
      "current:3900\n",
      "current:800\n",
      "current:13700\n",
      "current:4000\n",
      "current:900\n",
      "current:4100\n",
      "current:1000\n",
      "current:3100\n",
      "current:4200\n",
      "current:1100\n",
      "current:4300\n",
      "current:13800\n",
      "current:1200\n",
      "current:4400\n",
      "current:1300\n",
      "current:4500\n",
      "current:3200\n",
      "current:4600\n",
      "current:1400\n",
      "current:4700\n",
      "current:13900\n",
      "current:1500\n",
      "current:4800\n",
      "current:3300\n",
      "current:1600\n",
      "current:4900\n",
      "current:1700\n",
      "current:5000\n",
      "current:5100\n",
      "current:1800\n",
      "current:14000\n",
      "current:3400\n",
      "current:5200\n",
      "current:1900\n",
      "current:5300\n",
      "current:2000\n",
      "current:5400\n",
      "current:2100\n",
      "current:5500\n",
      "current:3500\n",
      "current:14100\n",
      "current:2200\n",
      "current:5600\n",
      "current:2300\n",
      "current:5700\n",
      "current:5800\n",
      "current:2400\n",
      "current:3600\n",
      "current:5900\n",
      "current:2500\n",
      "current:14200\n",
      "current:6000\n",
      "current:2600\n",
      "current:6100\n",
      "current:2700\n",
      "current:3700\n",
      "current:6200\n",
      "current:2800\n",
      "current:6300\n",
      "current:14300\n",
      "current:6400\n",
      "current:2900\n",
      "current:6500\n",
      "current:3000\n",
      "current:3800\n",
      "current:6600\n",
      "current:3100\n",
      "current:6700\n",
      "current:14400\n",
      "current:3200\n",
      "current:6800\n",
      "current:3900\n",
      "current:6900\n",
      "current:3300\n",
      "current:7000\n",
      "current:3400\n",
      "current:7100\n",
      "current:3500\n",
      "current:14500\n",
      "current:7200\n",
      "current:4000\n",
      "current:3600\n",
      "current:7300\n",
      "current:3700\n",
      "current:7400\n",
      "current:7500\n",
      "current:3800\n",
      "current:4100\n",
      "current:14600\n",
      "current:7600\n",
      "current:3900\n",
      "current:7700\n",
      "current:4000\n",
      "current:7800\n",
      "current:4100\n",
      "current:4200\n",
      "current:7900\n",
      "current:4200\n",
      "current:14700\n",
      "current:8000\n",
      "current:4300\n",
      "current:8100\n",
      "current:8200\n",
      "current:4300\n",
      "current:4400\n",
      "current:8300\n",
      "current:4500\n",
      "current:14800\n",
      "current:8400\n",
      "current:4600\n",
      "current:8500\n",
      "current:4400\n",
      "current:4700\n",
      "current:8600\n",
      "current:4800\n",
      "current:8700\n",
      "current:14900\n",
      "current:8800\n",
      "current:4900\n",
      "current:4500\n",
      "current:8900\n",
      "current:5000\n",
      "current:9000\n",
      "current:5100\n",
      "current:9100\n",
      "current:5200\n",
      "current:15000\n",
      "current:4600\n",
      "current:9200\n",
      "current:5300\n",
      "current:9300\n",
      "current:9400\n",
      "current:5400\n",
      "current:4700\n",
      "current:9500\n",
      "current:5500\n",
      "current:15100\n",
      "current:9600\n",
      "current:5600\n",
      "current:9700\n",
      "current:5700\n",
      "current:9800\n",
      "current:4800\n",
      "current:5800\n",
      "current:9900\n",
      "current:15200\n",
      "current:5900\n",
      "current:10000\n",
      "current:6000\n",
      "current:4900\n",
      "current:10100\n",
      "current:10200\n",
      "current:6100\n",
      "current:10300\n",
      "current:6200\n",
      "current:15300\n",
      "current:10400\n",
      "current:5000\n",
      "current:6300\n",
      "current:10500\n",
      "current:6400\n",
      "current:10600\n",
      "current:6500\n",
      "current:10700\n",
      "current:5100\n",
      "current:15400\n",
      "current:10800\n",
      "current:6600\n",
      "current:10900\n",
      "current:6700\n",
      "current:11000\n",
      "current:6800\n",
      "current:5200\n",
      "current:11100\n",
      "current:15500\n",
      "current:6900\n",
      "current:11200\n",
      "current:7000\n",
      "current:11300\n",
      "current:7100\n",
      "current:11400\n",
      "current:5300\n",
      "current:11500\n",
      "current:7200\n",
      "current:15600\n",
      "current:11600\n",
      "current:7300\n",
      "current:11700\n",
      "current:7400\n",
      "current:5400\n",
      "current:11800\n",
      "current:7500\n",
      "current:11900\n",
      "current:15700\n",
      "current:7600\n",
      "current:12000\n",
      "current:5500\n",
      "current:12100\n",
      "current:7700\n",
      "current:12200\n",
      "current:7800\n",
      "current:12300\n",
      "current:7900\n",
      "current:15800\n",
      "current:5600\n",
      "current:12400\n",
      "current:8000\n",
      "current:12500\n",
      "current:8100\n",
      "current:12600\n",
      "current:12700\n",
      "current:8200\n",
      "current:5700\n",
      "current:15900\n",
      "current:12800\n",
      "current:8300\n",
      "current:12900\n",
      "current:8400\n",
      "current:13000\n",
      "current:8500\n",
      "current:5800\n",
      "current:13100\n",
      "current:16000\n",
      "current:8600\n",
      "current:8700\n",
      "current:5900\n",
      "current:8800\n",
      "current:8900\n",
      "current:16100\n",
      "current:9000\n",
      "current:6000\n",
      "current:9100\n",
      "current:9200\n",
      "current:16200\n",
      "current:6100\n",
      "current:9300\n",
      "current:9400\n",
      "current:16300\n",
      "current:6200\n",
      "current:6300\n",
      "current:16400\n",
      "5da138754db8ce0c98bca82f_train.csv : 7188\n",
      "current:0\n",
      "current:100\n",
      "current:6400\n",
      "current:16500\n",
      "current:200\n",
      "current:300\n",
      "5da1389e4db8ce0c98bd0547_train.csv : 6312\n",
      "current:0\n",
      "current:100\n",
      "current:400\n",
      "current:6500\n",
      "current:200\n",
      "current:500\n",
      "current:300\n",
      "current:16600\n",
      "current:400\n",
      "current:600\n",
      "current:500\n",
      "current:700\n",
      "current:600\n",
      "current:6600\n",
      "current:800\n",
      "current:700\n",
      "current:800\n",
      "current:900\n",
      "current:16700\n",
      "current:900\n",
      "current:1000\n",
      "current:1000\n",
      "current:6700\n",
      "current:1100\n",
      "current:1100\n",
      "current:1200\n",
      "current:1200\n",
      "current:1300\n",
      "current:1300\n",
      "current:1400\n",
      "current:16800\n",
      "current:6800\n",
      "current:1500\n",
      "current:1400\n",
      "current:1600\n",
      "current:1500\n",
      "current:1700\n",
      "current:1800\n",
      "current:1600\n",
      "current:1900\n",
      "current:6900\n",
      "current:16900\n",
      "current:1700\n",
      "current:2000\n",
      "current:1800\n",
      "current:2100\n",
      "current:2200\n",
      "current:1900\n",
      "current:7000\n",
      "current:2300\n",
      "current:2000\n",
      "current:2400\n",
      "current:17000\n",
      "current:2500\n",
      "current:2100\n",
      "current:2600\n",
      "current:2200\n",
      "current:2700\n",
      "current:7100\n",
      "current:2800\n",
      "current:2300\n",
      "current:2900\n",
      "current:2400\n",
      "current:17100\n",
      "current:3000\n",
      "current:2500\n",
      "current:3100\n",
      "current:7200\n",
      "current:3200\n",
      "current:2600\n",
      "current:3300\n",
      "current:2700\n",
      "current:3400\n",
      "current:17200\n",
      "current:2800\n",
      "current:3500\n",
      "current:7300\n",
      "current:3600\n",
      "current:2900\n",
      "current:3700\n",
      "current:3000\n",
      "current:3800\n",
      "current:3900\n",
      "current:3100\n",
      "current:4000\n",
      "current:17300\n",
      "current:7400\n",
      "current:3200\n",
      "current:4100\n",
      "current:3300\n",
      "current:4200\n",
      "current:4300\n",
      "current:3400\n",
      "current:4400\n",
      "current:3500\n",
      "current:7500\n",
      "current:4500\n",
      "current:17400\n",
      "current:4600\n",
      "current:3600\n",
      "current:4700\n",
      "current:3700\n",
      "current:4800\n",
      "current:3800\n",
      "current:4900\n",
      "current:7600\n",
      "current:5000\n",
      "current:3900\n",
      "current:17500\n",
      "current:5100\n",
      "current:4000\n",
      "current:5200\n",
      "current:5300\n",
      "current:4100\n",
      "current:7700\n",
      "current:5400\n",
      "current:4200\n",
      "current:5500\n",
      "current:4300\n",
      "current:17600\n",
      "current:5600\n",
      "current:5700\n",
      "current:4400\n",
      "current:7800\n",
      "current:5800\n",
      "current:4500\n",
      "current:5900\n",
      "current:4600\n",
      "current:6000\n",
      "current:6100\n",
      "current:17700\n",
      "current:4700\n",
      "current:6200\n",
      "current:7900\n",
      "current:4800\n",
      "current:6300\n",
      "current:4900\n",
      "current:5000\n",
      "current:17800\n",
      "current:8000\n",
      "current:5100\n",
      "current:5200\n",
      "current:5300\n",
      "current:8100\n",
      "current:5400\n",
      "current:17900\n",
      "current:5500\n",
      "current:5600\n",
      "current:5700\n",
      "current:8200\n",
      "current:18000\n",
      "current:5800\n",
      "current:5900\n",
      "current:6000\n",
      "current:8300\n",
      "current:6100\n",
      "current:18100\n",
      "current:6200\n",
      "current:6300\n",
      "current:8400\n",
      "current:6400\n",
      "current:18200\n",
      "current:6500\n",
      "current:6600\n",
      "current:8500\n",
      "current:6700\n",
      "current:6800\n",
      "current:18300\n",
      "current:6900\n",
      "current:8600\n",
      "current:7000\n",
      "current:7100\n",
      "current:18400\n",
      "current:8700\n",
      "current:18500\n",
      "current:8800\n",
      "current:18600\n",
      "current:8900\n",
      "current:9000\n",
      "5da138b74db8ce0c98bd4774_train.csv : 17382\n",
      "current:0\n",
      "current:18700\n",
      "current:100\n",
      "current:9100\n",
      "current:18800\n",
      "current:200\n",
      "current:9200\n",
      "current:300\n",
      "current:18900\n",
      "current:400\n",
      "current:9300\n",
      "current:500\n",
      "current:19000\n",
      "current:600\n",
      "current:9400\n",
      "current:700\n",
      "current:19100\n",
      "current:800\n",
      "current:9500\n",
      "current:900\n",
      "current:19200\n",
      "current:9600\n",
      "current:1000\n",
      "current:1100\n",
      "current:9700\n",
      "current:19300\n",
      "current:1200\n",
      "current:9800\n",
      "current:1300\n",
      "current:19400\n",
      "current:1400\n",
      "current:9900\n",
      "current:1500\n",
      "current:19500\n",
      "current:10000\n",
      "current:1600\n",
      "current:1700\n",
      "current:19600\n",
      "current:1800\n",
      "5dbc1d84c1eb61796cf7c010_train.csv : 16174\n",
      "current:0\n",
      "current:1900\n",
      "current:19700\n",
      "current:2000\n",
      "current:100\n",
      "current:2100\n",
      "current:19800\n",
      "current:200\n",
      "current:2200\n",
      "current:300\n",
      "current:400\n",
      "current:2300\n",
      "current:19900\n",
      "current:500\n",
      "current:2400\n",
      "current:20000\n",
      "current:600\n",
      "current:2500\n",
      "current:700\n",
      "current:2600\n",
      "current:800\n",
      "current:20100\n",
      "current:2700\n",
      "current:900\n",
      "current:2800\n",
      "current:1000\n",
      "current:20200\n",
      "current:2900\n",
      "current:1100\n",
      "current:1200\n",
      "current:3000\n",
      "current:20300\n",
      "current:1300\n",
      "current:3100\n",
      "current:1400\n",
      "current:3200\n",
      "current:1500\n",
      "current:20400\n",
      "current:3300\n",
      "current:1600\n",
      "current:1700\n",
      "current:3400\n",
      "current:20500\n",
      "current:1800\n",
      "current:3500\n",
      "current:1900\n",
      "current:20600\n",
      "current:3600\n",
      "current:2000\n",
      "current:3700\n",
      "current:2100\n",
      "current:20700\n",
      "current:3800\n",
      "current:2200\n",
      "current:3900\n",
      "current:20800\n",
      "current:2300\n",
      "current:4000\n",
      "current:20900\n",
      "current:2400\n",
      "current:4100\n",
      "current:2500\n",
      "current:21000\n",
      "current:4200\n",
      "current:4300\n",
      "current:2600\n",
      "current:4400\n",
      "current:21100\n",
      "current:4500\n",
      "current:2700\n",
      "current:4600\n",
      "current:4700\n",
      "current:2800\n",
      "current:21200\n",
      "current:4800\n",
      "current:2900\n",
      "current:4900\n",
      "current:21300\n",
      "current:3000\n",
      "current:5000\n",
      "current:21400\n",
      "current:3100\n",
      "current:5100\n",
      "current:21500\n",
      "current:5200\n",
      "current:3200\n",
      "current:5300\n",
      "current:21600\n",
      "current:3300\n",
      "current:5400\n",
      "current:3400\n",
      "current:21700\n",
      "current:5500\n",
      "current:3500\n",
      "current:5600\n",
      "current:21800\n",
      "current:3600\n",
      "current:5700\n",
      "current:5800\n",
      "current:21900\n",
      "current:3700\n",
      "current:5900\n",
      "current:3800\n",
      "current:6000\n",
      "current:3900\n",
      "current:22000\n",
      "current:6100\n",
      "current:4000\n",
      "current:6200\n",
      "current:4100\n",
      "current:22100\n",
      "current:4200\n",
      "current:6300\n",
      "current:6400\n",
      "current:4300\n",
      "current:6500\n",
      "current:22200\n",
      "current:6600\n",
      "current:4400\n",
      "current:6700\n",
      "current:22300\n",
      "current:4500\n",
      "current:6800\n",
      "current:4600\n",
      "current:4700\n",
      "current:6900\n",
      "current:22400\n",
      "current:4800\n",
      "current:7000\n",
      "current:22500\n",
      "current:4900\n",
      "current:7100\n",
      "current:22600\n",
      "current:7200\n",
      "current:5000\n",
      "current:7300\n",
      "current:5100\n",
      "current:22700\n",
      "current:7400\n",
      "current:7500\n",
      "current:5200\n",
      "current:22800\n",
      "current:7600\n",
      "current:7700\n",
      "current:5300\n",
      "current:7800\n",
      "current:22900\n",
      "current:7900\n",
      "current:5400\n",
      "current:8000\n",
      "current:5500\n",
      "current:23000\n",
      "current:8100\n",
      "current:8200\n",
      "current:5600\n",
      "current:8300\n",
      "current:23100\n",
      "current:8400\n",
      "current:5700\n",
      "current:8500\n",
      "current:8600\n",
      "current:5800\n",
      "current:23200\n",
      "current:8700\n",
      "current:5900\n",
      "current:23300\n",
      "current:8800\n",
      "current:6000\n",
      "current:8900\n",
      "current:23400\n",
      "current:9000\n",
      "current:6100\n",
      "current:9100\n",
      "current:9200\n",
      "current:23500\n",
      "current:6200\n",
      "current:9300\n",
      "current:6300\n",
      "current:6400\n",
      "current:9400\n",
      "current:23600\n",
      "current:6500\n",
      "current:9500\n",
      "current:6600\n",
      "current:9600\n",
      "current:6700\n",
      "current:9700\n",
      "current:6800\n",
      "current:9800\n",
      "current:9900\n",
      "current:6900\n",
      "current:10000\n",
      "current:7000\n",
      "current:10100\n",
      "current:7100\n",
      "current:10200\n",
      "current:7200\n",
      "current:10300\n",
      "current:7300\n",
      "current:10400\n",
      "current:7400\n",
      "current:10500\n",
      "current:10600\n",
      "current:7500\n",
      "current:10700\n",
      "current:7600\n",
      "current:10800\n",
      "current:7700\n",
      "current:10900\n",
      "current:7800\n",
      "current:11000\n",
      "current:11100\n",
      "current:7900\n",
      "current:11200\n",
      "current:8000\n",
      "current:11300\n",
      "current:8100\n",
      "current:11400\n",
      "current:8200\n",
      "current:11500\n",
      "current:8300\n",
      "current:11600\n",
      "current:11700\n",
      "current:8400\n",
      "current:11800\n",
      "current:11900\n",
      "5d27096c03f801723c31e5e0_train.csv : 9100\n",
      "current:0\n",
      "current:8500\n",
      "current:12000\n",
      "current:12100\n",
      "current:100\n",
      "current:8600\n",
      "current:12200\n",
      "current:12300\n",
      "current:8700\n",
      "current:200\n",
      "current:12400\n",
      "current:8800\n",
      "current:300\n",
      "current:12500\n",
      "current:8900\n",
      "current:12600\n",
      "current:400\n",
      "current:9000\n",
      "current:12700\n",
      "current:500\n",
      "current:12800\n",
      "current:600\n",
      "current:9100\n",
      "current:12900\n",
      "current:13000\n",
      "current:9200\n",
      "current:700\n",
      "current:13100\n",
      "current:13200\n",
      "current:9300\n",
      "current:800\n",
      "current:13300\n",
      "current:9400\n",
      "current:13400\n",
      "current:900\n",
      "current:1000\n",
      "current:13500\n",
      "current:9500\n",
      "current:13600\n",
      "current:9600\n",
      "current:1100\n",
      "current:9700\n",
      "current:13700\n",
      "current:1200\n",
      "current:9800\n",
      "current:13800\n",
      "current:9900\n",
      "current:13900\n",
      "current:1300\n",
      "current:10000\n",
      "current:14000\n",
      "current:1400\n",
      "current:10100\n",
      "current:14100\n",
      "current:14200\n",
      "current:1500\n",
      "current:10200\n",
      "current:14300\n",
      "current:14400\n",
      "current:1600\n",
      "current:10300\n",
      "current:14500\n",
      "current:10400\n",
      "current:1700\n",
      "current:10500\n",
      "current:14600\n",
      "current:1800\n",
      "current:14700\n",
      "current:10600\n",
      "current:1900\n",
      "current:14800\n",
      "current:10700\n",
      "current:2000\n",
      "current:14900\n",
      "current:15000\n",
      "current:10800\n",
      "current:2100\n",
      "current:15100\n",
      "current:10900\n",
      "current:15200\n",
      "current:2200\n",
      "current:11000\n",
      "current:15300\n",
      "current:2300\n",
      "current:11100\n",
      "current:15400\n",
      "current:2400\n",
      "current:11200\n",
      "current:15500\n",
      "current:15600\n",
      "current:2500\n",
      "current:11300\n",
      "current:15700\n",
      "current:15800\n",
      "current:11400\n",
      "current:2600\n",
      "current:15900\n",
      "current:16000\n",
      "current:11500\n",
      "current:2700\n",
      "current:16100\n",
      "current:16200\n",
      "current:11600\n",
      "current:2800\n",
      "current:16300\n",
      "current:2900\n",
      "current:11700\n",
      "current:16400\n",
      "current:3000\n",
      "current:11800\n",
      "current:16500\n",
      "current:3100\n",
      "current:16600\n",
      "current:11900\n",
      "current:3200\n",
      "current:16700\n",
      "current:12000\n",
      "current:3300\n",
      "current:16800\n",
      "current:3400\n",
      "current:12100\n",
      "current:16900\n",
      "current:17000\n",
      "current:3500\n",
      "current:12200\n",
      "current:17100\n",
      "current:17200\n",
      "current:12300\n",
      "current:3600\n",
      "current:17300\n",
      "current:12400\n",
      "current:3700\n",
      "current:12500\n",
      "current:3800\n",
      "current:12600\n",
      "current:3900\n",
      "current:12700\n",
      "current:4000\n",
      "current:12800\n",
      "current:12900\n",
      "current:4100\n",
      "current:13000\n",
      "current:4200\n",
      "current:13100\n",
      "current:13200\n",
      "current:4300\n",
      "current:13300\n",
      "current:4400\n",
      "current:13400\n",
      "current:4500\n",
      "current:13500\n",
      "current:4600\n",
      "current:13600\n",
      "current:4700\n",
      "current:13700\n",
      "current:4800\n",
      "current:13800\n",
      "current:4900\n",
      "current:13900\n",
      "current:14000\n",
      "current:5000\n",
      "current:14100\n",
      "current:5100\n",
      "current:14200\n",
      "current:5200\n",
      "5da958dd46f8266d0737457b_train.csv : 15148\n",
      "current:0\n",
      "current:14300\n",
      "current:5300\n",
      "current:100\n",
      "current:5400\n",
      "current:14400\n",
      "current:200\n",
      "current:5500\n",
      "current:300\n",
      "current:14500\n",
      "current:5600\n",
      "current:400\n",
      "current:14600\n",
      "current:5700\n",
      "current:500\n",
      "current:5800\n",
      "current:14700\n",
      "current:600\n",
      "current:5900\n",
      "current:14800\n",
      "current:700\n",
      "current:6000\n",
      "current:14900\n",
      "current:800\n",
      "current:15000\n",
      "current:6100\n",
      "current:900\n",
      "current:15100\n",
      "current:1000\n",
      "current:15200\n",
      "current:6200\n",
      "current:1100\n",
      "current:15300\n",
      "current:6300\n",
      "current:1200\n",
      "current:15400\n",
      "current:1300\n",
      "current:6400\n",
      "current:1400\n",
      "current:15500\n",
      "current:1500\n",
      "current:15600\n",
      "current:6500\n",
      "current:1600\n",
      "current:1700\n",
      "current:15700\n",
      "current:6600\n",
      "current:1800\n",
      "current:1900\n",
      "current:15800\n",
      "current:2000\n",
      "current:6700\n",
      "current:2100\n",
      "current:15900\n",
      "current:2200\n",
      "current:6800\n",
      "current:2300\n",
      "current:16000\n",
      "current:2400\n",
      "current:6900\n",
      "current:2500\n",
      "current:16100\n",
      "current:2600\n",
      "current:7000\n",
      "current:2700\n",
      "current:2800\n",
      "current:2900\n",
      "current:7100\n",
      "current:3000\n",
      "current:7200\n",
      "current:3100\n",
      "current:3200\n",
      "current:7300\n",
      "current:3300\n",
      "current:3400\n",
      "current:7400\n",
      "current:3500\n",
      "current:7500\n",
      "current:3600\n",
      "current:3700\n",
      "current:7600\n",
      "current:3800\n",
      "current:7700\n",
      "current:3900\n",
      "current:4000\n",
      "current:7800\n",
      "current:4100\n",
      "current:4200\n",
      "current:7900\n",
      "current:4300\n",
      "current:8000\n",
      "current:4400\n",
      "current:8100\n",
      "current:4500\n",
      "current:8200\n",
      "current:4600\n",
      "current:8300\n",
      "current:4700\n",
      "current:8400\n",
      "current:4800\n",
      "current:8500\n",
      "current:4900\n",
      "current:5000\n",
      "current:8600\n",
      "current:5100\n",
      "current:5200\n",
      "current:8700\n",
      "current:5300\n",
      "current:5400\n",
      "current:8800\n",
      "current:5500\n",
      "current:8900\n",
      "current:5600\n",
      "current:9000\n",
      "current:5700\n",
      "current:5800\n",
      "current:5900\n",
      "current:6000\n",
      "current:6100\n",
      "5dc8cea7659e181adb076a3f_train.csv : 15655\n",
      "current:0\n",
      "current:6200\n",
      "current:6300\n",
      "current:100\n",
      "current:6400\n",
      "current:200\n",
      "current:6500\n",
      "current:6600\n",
      "current:300\n",
      "current:6700\n",
      "current:400\n",
      "current:6800\n",
      "current:500\n",
      "current:6900\n",
      "current:7000\n",
      "current:600\n",
      "current:7100\n",
      "current:700\n",
      "current:7200\n",
      "current:800\n",
      "current:7300\n",
      "current:7400\n",
      "current:900\n",
      "current:7500\n",
      "current:1000\n",
      "current:7600\n",
      "current:1100\n",
      "current:7700\n",
      "current:7800\n",
      "current:1200\n",
      "current:7900\n",
      "current:1300\n",
      "current:8000\n",
      "current:1400\n",
      "current:8100\n",
      "current:8200\n",
      "current:1500\n",
      "current:8300\n",
      "current:1600\n",
      "current:8400\n",
      "current:1700\n",
      "current:8500\n",
      "current:8600\n",
      "current:1800\n",
      "current:8700\n",
      "current:1900\n",
      "current:8800\n",
      "current:8900\n",
      "current:2000\n",
      "current:9000\n",
      "current:2100\n",
      "current:9100\n",
      "current:2200\n",
      "current:9200\n",
      "current:9300\n",
      "current:2300\n",
      "current:9400\n",
      "current:2400\n",
      "current:9500\n",
      "current:2500\n",
      "current:9600\n",
      "current:9700\n",
      "current:2600\n",
      "current:9800\n",
      "current:2700\n",
      "current:9900\n",
      "current:10000\n",
      "current:2800\n",
      "current:10100\n",
      "current:2900\n",
      "current:10200\n",
      "current:3000\n",
      "current:10300\n",
      "current:10400\n",
      "current:3100\n",
      "current:10500\n",
      "current:3200\n",
      "current:10600\n",
      "current:3300\n",
      "current:10700\n",
      "current:10800\n",
      "current:3400\n",
      "current:10900\n",
      "current:3500\n",
      "current:11000\n",
      "current:3600\n",
      "current:11100\n",
      "current:11200\n",
      "current:3700\n",
      "current:11300\n",
      "current:3800\n",
      "current:11400\n",
      "current:3900\n",
      "current:11500\n",
      "current:11600\n",
      "current:4000\n",
      "current:11700\n",
      "current:4100\n",
      "current:11800\n",
      "current:4200\n",
      "current:11900\n",
      "current:12000\n",
      "current:4300\n",
      "current:12100\n",
      "current:4400\n",
      "current:12200\n",
      "current:4500\n",
      "current:12300\n",
      "current:4600\n",
      "current:12400\n",
      "current:12500\n",
      "current:4700\n",
      "current:12600\n",
      "current:4800\n",
      "current:12700\n",
      "current:12800\n",
      "current:4900\n",
      "current:12900\n",
      "current:5000\n",
      "current:13000\n",
      "current:5100\n",
      "current:13100\n",
      "current:13200\n",
      "current:5200\n",
      "current:13300\n",
      "current:5300\n",
      "current:13400\n",
      "current:5400\n",
      "current:13500\n",
      "current:5500\n",
      "current:13600\n",
      "current:13700\n",
      "current:5600\n",
      "current:13800\n",
      "current:5700\n",
      "current:13900\n",
      "current:14000\n",
      "current:5800\n",
      "current:14100\n",
      "current:5900\n",
      "current:14200\n",
      "current:6000\n",
      "current:14300\n",
      "current:14400\n",
      "current:6100\n",
      "current:14500\n",
      "current:6200\n",
      "current:14600\n",
      "current:6300\n",
      "current:14700\n",
      "current:14800\n",
      "current:6400\n",
      "current:14900\n",
      "current:6500\n",
      "current:15000\n",
      "current:6600\n",
      "current:15100\n",
      "current:6700\n",
      "current:6800\n",
      "current:6900\n",
      "current:7000\n",
      "current:7100\n",
      "current:7200\n",
      "current:7300\n",
      "current:7400\n",
      "current:7500\n",
      "current:7600\n",
      "current:7700\n",
      "current:7800\n",
      "current:7900\n",
      "current:8000\n",
      "current:8100\n",
      "current:8200\n",
      "current:8300\n",
      "current:8400\n",
      "current:8500\n",
      "current:8600\n",
      "current:8700\n",
      "current:8800\n",
      "current:8900\n",
      "current:9000\n",
      "current:9100\n",
      "current:9200\n",
      "current:9300\n",
      "current:9400\n",
      "current:9500\n",
      "current:9600\n",
      "current:9700\n",
      "current:9800\n",
      "current:9900\n",
      "current:10000\n",
      "current:10100\n",
      "current:10200\n",
      "current:10300\n",
      "current:10400\n",
      "current:10500\n",
      "current:10600\n",
      "current:10700\n",
      "current:10800\n",
      "current:10900\n",
      "current:11000\n",
      "current:11100\n",
      "current:11200\n",
      "current:11300\n",
      "current:11400\n",
      "current:11500\n",
      "current:11600\n",
      "current:11700\n",
      "current:11800\n",
      "current:11900\n",
      "current:12000\n",
      "current:12100\n",
      "current:12200\n",
      "current:12300\n",
      "current:12400\n",
      "current:12500\n",
      "current:12600\n",
      "current:12700\n",
      "current:12800\n",
      "current:12900\n",
      "current:13000\n",
      "current:13100\n",
      "current:13200\n",
      "current:13300\n",
      "current:13400\n",
      "current:13500\n",
      "current:13600\n",
      "current:13700\n",
      "current:13800\n",
      "current:13900\n",
      "current:14000\n",
      "current:14100\n",
      "current:14200\n",
      "current:14300\n",
      "current:14400\n",
      "current:14500\n",
      "current:14600\n",
      "current:14700\n",
      "current:14800\n",
      "current:14900\n",
      "current:15000\n",
      "current:15100\n",
      "current:15200\n",
      "current:15300\n",
      "current:15400\n",
      "current:15500\n",
      "current:15600\n"
     ]
    }
   ],
   "source": [
    "with Pool(num_cores) as pool:\n",
    "    pool.map(generate_training_data, [t for t in train_files])  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-03-28T22:20:56.491136Z",
     "iopub.status.busy": "2021-03-28T22:20:56.490235Z",
     "iopub.status.idle": "2021-03-28T22:20:56.493395Z",
     "shell.execute_reply": "2021-03-28T22:20:56.492857Z"
    },
    "papermill": {
     "duration": 0.74664,
     "end_time": "2021-03-28T22:20:56.493552",
     "exception": false,
     "start_time": "2021-03-28T22:20:55.746912",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [],
   "source": [
    "def generate_test_data(test_file):\n",
    "    train = pd.read_csv(test_file)\n",
    "\n",
    "    file_name = test_file.split('/')[-1]\n",
    "\n",
    "    num_of_lines = train.shape[0]\n",
    "    print(f'{file_name} : {num_of_lines}')\n",
    "\n",
    "    data = []\n",
    "    for i in range(num_of_lines):\n",
    "        if i % 100 == 0:\n",
    "            print(f'current:{i}')\n",
    "\n",
    "        tmp = train.iloc[i,1:-4].astype(int).sort_values(ascending=False).head(ITEMS_TO_TAKE)\n",
    "        target = train.iloc[i, [-1]]\n",
    "\n",
    "        line = [*tmp.index.astype(str), *tmp.values, *target]\n",
    "        data.append(line)\n",
    "    data = pd.DataFrame(data)\n",
    "    data.columns = [f'bssid_{str(i)}' for i in range(ITEMS_TO_TAKE)] + [f'rssi_{str(i)}' for i in range(ITEMS_TO_TAKE)] + ['site_path_timestamp']\n",
    "    data.to_csv(f'../input/indoor-unified-wifi-ds/{file_name}', index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "_kg_hide-output": true,
    "execution": {
     "iopub.execute_input": "2021-03-28T22:20:57.967059Z",
     "iopub.status.busy": "2021-03-28T22:20:57.966307Z",
     "iopub.status.idle": "2021-03-28T22:21:32.297505Z",
     "shell.execute_reply": "2021-03-28T22:21:32.296929Z"
    },
    "papermill": {
     "duration": 35.065184,
     "end_time": "2021-03-28T22:21:32.297656",
     "exception": false,
     "start_time": "2021-03-28T22:20:57.232472",
     "status": "completed"
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5d2709a003f801723c3251bf_test.csv : 218\n",
      "current:0\n",
      "current:100\n",
      "5d27097f03f801723c320d97_test.csv : 303\n",
      "current:0\n",
      "5a0546857ecc773753327266_test.csv : 299\n",
      "current:0\n",
      "5d27075f03f801723c2e360f_test.csv : 47\n",
      "current:0\n",
      "current:200\n",
      "current:100\n",
      "current:100\n",
      "5d2709b303f801723c327472_test.csv : 527\n",
      "current:0\n",
      "current:200\n",
      "current:100\n",
      "current:200\n",
      "current:300\n",
      "5d27099f03f801723c32511d_test.csv : 49\n",
      "current:0\n",
      "current:200\n",
      "current:300\n",
      "5d27096c03f801723c31e5e0_test.csv : 654\n",
      "current:0\n",
      "5c3c44b80379370013e0fd2b_test.csv : 26\n",
      "current:0\n",
      "5d2709bb03f801723c32852c_test.csv : 716\n",
      "current:0\n",
      "current:400\n",
      "current:500\n",
      "current:100\n",
      "current:100\n",
      "5da138274db8ce0c98bbd3d2_test.csv : 103\n",
      "current:0\n",
      "5d2709d403f801723c32bd39_test.csv : 1223\n",
      "current:0\n",
      "current:100\n",
      "current:200\n",
      "current:100\n",
      "5da1382d4db8ce0c98bbe92e_test.csv : 311\n",
      "current:0\n",
      "current:300\n",
      "current:200\n",
      "current:200\n",
      "current:400\n",
      "current:100\n",
      "current:300\n",
      "current:300\n",
      "current:500\n",
      "current:200\n",
      "current:400\n",
      "current:600\n",
      "current:500\n",
      "current:300\n",
      "current:400\n",
      "5da138314db8ce0c98bbf3a0_test.csv : 171\n",
      "current:0\n",
      "current:700\n",
      "current:600\n",
      "current:100\n",
      "current:700\n",
      "5da138364db8ce0c98bc00f1_test.csv : 139\n",
      "current:0\n",
      "current:500\n",
      "current:100\n",
      "current:800\n",
      "5da1383b4db8ce0c98bc11ab_test.csv : 380\n",
      "current:0\n",
      "current:900\n",
      "5d2709c303f801723c3299ee_test.csv : 509\n",
      "current:0\n",
      "current:100\n",
      "current:600\n",
      "current:1000\n",
      "current:200\n",
      "current:1100\n",
      "current:300\n",
      "current:100\n",
      "current:1200\n",
      "5da138764db8ce0c98bcaa46_test.csv : 573\n",
      "current:0\n",
      "5da138754db8ce0c98bca82f_test.csv : 386\n",
      "current:0\n",
      "current:100\n",
      "current:100\n",
      "5d2709e003f801723c32d896_test.csv : 531\n",
      "current:0\n",
      "current:200\n",
      "current:200\n",
      "current:200\n",
      "current:100\n",
      "current:300\n",
      "current:300\n",
      "current:200\n",
      "current:300\n",
      "current:400\n",
      "current:300\n",
      "current:400\n",
      "current:500\n",
      "current:500\n",
      "5da138b74db8ce0c98bd4774_test.csv : 445\n",
      "current:0\n",
      "5da1389e4db8ce0c98bd0547_test.csv : 174\n",
      "current:0\n",
      "current:100\n",
      "current:400\n",
      "current:100\n",
      "current:200\n",
      "current:500\n",
      "5dbc1d84c1eb61796cf7c010_test.csv : 923\n",
      "current:0\n",
      "current:300\n",
      "current:100\n",
      "current:400\n",
      "current:200\n",
      "5da958dd46f8266d0737457b_test.csv : 778\n",
      "current:0\n",
      "current:300\n",
      "current:100\n",
      "current:400\n",
      "current:200\n",
      "current:500\n",
      "current:300\n",
      "current:600\n",
      "current:400\n",
      "current:500\n",
      "current:700\n",
      "current:600\n",
      "current:800\n",
      "current:700\n",
      "current:900\n",
      "5dc8cea7659e181adb076a3f_test.csv : 648\n",
      "current:0\n",
      "current:100\n",
      "current:200\n",
      "current:300\n",
      "current:400\n",
      "current:500\n",
      "current:600\n"
     ]
    }
   ],
   "source": [
    "with Pool(num_cores) as pool:\n",
    "    pool.map(generate_test_data, [t for t in test_files])  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# import pickle\n",
    "# feature_dir = f\"../input/indoor-unified-wifi-ds\"\n",
    "# with open(f'{feature_dir}/train_all.pkl', 'rb') as f:\n",
    "#   data = pickle.load( f)\n",
    "\n",
    "# with open(f'{feature_dir}/test_all.pkl', 'rb') as f:\n",
    "#   test_data = pickle.load(f)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "feature_dir = f\"../input/indoor-unified-wifi-ds\"\n",
    "train_files = sorted(glob.glob(os.path.join(feature_dir, '*_train.csv')))\n",
    "test_files = sorted(glob.glob(os.path.join(feature_dir, '*_test.csv')))\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "trainpd = []\n",
    "for xx in train_files:\n",
    "    tmp = pd.read_csv(xx)\n",
    "    tmp['site_id'] = xx.split('/')[-1].split('_')[0]\n",
    "    trainpd.append(tmp)\n",
    "trainpd = pd.concat(trainpd).reset_index(drop=True)\n",
    "\n",
    "testpd = []\n",
    "for xx in test_files:\n",
    "    tmp = pd.read_csv(xx)\n",
    "    tmp['site_id'] = xx.split('/')[-1].split('_')[0]\n",
    "    testpd.append(tmp)\n",
    "testpd = pd.concat(testpd).reset_index(drop=True)\n",
    "sub = pd.read_csv('../input/indoor-location-navigation/sample_submission.csv')\n",
    "testpd['site_path_timestamp'] = sub['site_path_timestamp'].copy()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(f'{feature_dir}/train_all.pkl', 'wb') as f:\n",
    "    pickle.dump(trainpd,f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(f'{feature_dir}/test_all.pkl', 'wb') as f:\n",
    "    pickle.dump(testpd,f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(10133, 201)"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "testpd.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "papermill": {
   "default_parameters": {},
   "duration": 1064.420824,
   "end_time": "2021-03-28T22:21:33.581724",
   "environment_variables": {},
   "exception": null,
   "input_path": "__notebook__.ipynb",
   "output_path": "__notebook__.ipynb",
   "parameters": {},
   "start_time": "2021-03-28T22:03:49.160900",
   "version": "2.2.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
